package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.SystemType;
import com.rockcent.mall.lib.domain.enumclass.MenuResourceType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by oyhk on 2017/3/9.
 *
 * R端 用户表
 */
@Entity
@Table(name = "auth_resource")
@DynamicInsert
@DynamicUpdate
public class AuthResource extends IDEntityMall {

    @Column(columnDefinition = "bigint comment '父菜单资源'")
    private Long parentId;
    @Column(columnDefinition = "varchar(50) comment '图标名称'")
    private String iconName;
    @Column(columnDefinition = "varchar(50) comment '名称'")
    private String name;
    @Column(columnDefinition = "varchar(50) comment '前端url'")
    private String frontendUrl;
    @Column(columnDefinition = "varchar(255) comment '后端url'")
    private String backendUrl;
    @Column(columnDefinition = "varchar(50) comment '类型 FRONTEND(\"前端\"),BACKEND(\"后端\")'")
    @Enumerated(EnumType.STRING)
    private MenuResourceType type;
    @Column(columnDefinition = "bigint comment '排序号'")
    private Long sort;
    @Column(columnDefinition = "varchar(50) comment '系统类型 ADMIN(\"R端\"),MALL(\"M端\"),MERCHANT(\"B端\")'")
    @Enumerated(EnumType.STRING)
    private SystemType systemType;

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getIconName() {
        return iconName;
    }

    public void setIconName(String iconName) {
        this.iconName = iconName;
    }

    public String getFrontendUrl() {
        return frontendUrl;
    }

    public void setFrontendUrl(String frontendUrl) {
        this.frontendUrl = frontendUrl;
    }

    public String getBackendUrl() {
        return backendUrl;
    }

    public void setBackendUrl(String backendUrl) {
        this.backendUrl = backendUrl;
    }

    public MenuResourceType getType() {
        return type;
    }

    public void setType(MenuResourceType type) {
        this.type = type;
    }

    public Long getSort() {
        return sort;
    }

    public void setSort(Long sort) {
        this.sort = sort;
    }

    public SystemType getSystemType() {
        return systemType;
    }

    public void setSystemType(SystemType systemType) {
        this.systemType = systemType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "AuthResource{" +
                "parentId=" + parentId +
                ", iconName='" + iconName + '\'' +
                ", name='" + name + '\'' +
                ", frontendUrl='" + frontendUrl + '\'' +
                ", backendUrl='" + backendUrl + '\'' +
                ", type=" + type +
                ", sort=" + sort +
                ", systemType=" + systemType +
                '}';
    }
}
